<%--
  Created by IntelliJ IDEA.
  User: MAVI003
  Date: 2017/4/1
  Time: 14:41
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta charset="utf-8">
    <title>商品详情</title>
    <link rel="shortcut icon" href="${pageContext.request.contextPath}/images/icon.jpg">
    <link rel="bookmark" href="${pageContext.request.contextPath}/images/icon.jpg">

    <link href="//cdn.bootcss.com/bootstrap/3.0.1/css/bootstrap.min.css" rel="stylesheet">
    <link href="http://ibootstrap-file.b0.upaiyun.com/www.layoutit.com/css/builder/v3/layoutit.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/css/layoutit.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/css/my.css" rel="stylesheet">
    <script type="text/javascript" src="http://cdn.staticfile.org/jquery/2.0.0/jquery.min.js"></script>
    <script type="text/javascript" src="http://cdn.staticfile.org/jqueryui/1.10.2/jquery-ui.min.js"></script>
    <script type="text/javascript"
            src="http://cdn.staticfile.org/jqueryui-touch-punch/0.2.2/jquery.ui.touch-punch.min.js"></script>
    <script type="text/javascript" src="http://cdn.staticfile.org/twitter-bootstrap/3.0.1/js/bootstrap.min.js"></script>
    <script type="text/javascript"
            src="http://ibootstrap-file.b0.upaiyun.com/www.layoutit.com/js/jquery.htmlClean.js"></script>
    <script type="text/javascript"
            src="http://ibootstrap-file.b0.upaiyun.com/www.layoutit.com/js/builder/v3/scripts.min.js"></script>

    <style type="text/css">
        body{
            background-image: url(${pageContext.request.contextPath}/images/7.jpg);
            background-size:cover;
        }
        .myback{
            background-image: url(${pageContext.request.contextPath}/images/7.jpg);
            background-size:cover;
        }
    </style>

    <script>
        $(document).ready(function(){
           var state = "${state}";　
           if (state==-2){
               alert("出价请高于当前价格！");
           }
            if (state==-1){
                alert("余额不足，请充值！");
            }
            if (state==-3){
                alert("该商品状态不是拍卖中！");
            }
            if (state==-5){
                alert("不能为自己加价！");
            }
         });
    </script>
</head>
<body>
<div class="container">

    <div class="row clearfix hideLine">
        <div class="col-md-12 column hideLine myback">
            <jsp:include page="navigation.jsp"></jsp:include>
            <ul class="breadcrumb">
                <li>
                    <a href="#">全部分类</a>
                </li>
                <li>
                    <a href="#">
                        <c:if test="${goods.gkindid == 1}">
                            书籍
                        </c:if>
                        <c:if test="${goods.gkindid == 0}">
                            其他
                        </c:if>
                    </a>
                </li>
                <li>
                    <a href="#">${goods.gname}</a>
                </li>
            </ul>
            <div class="row clearfix">
                <div class="col-md-4">
                    <img height="500" width="350" src="${pageContext.request.contextPath}/upload/${goods.gpicture}"
                         class="img-rounded"/>
                </div>
                <div class="col-md-8">
                    <div class="row clearfix">
                        <h1>
                            ${goods.gname}
                        </h1>
                    </div>
                    <div class="row clearfix">
                        <div class="col-md-4"><label><h3>商品底价：</h3></label></div>
                        <span class="col-md-8"><h3>${goods.gprice}</h3></span>
                    </div>
                    <div class="row clearfix">
                        <div class="col-md-4"><label><h3>商品当前价格：</h3></label></div>
                        <span class="col-md-8"><h3>${nowprice}</h3></span>
                    </div>
                    <div class="row clearfix">
                        <div class="col-md-4"><label><h3>商品发布人：</h3></label></div>
                        <span class="col-md-8"><h3>${goods.gowner}</h3></span>
                    </div>
                    <div class="row clearfix">
                        <div class="col-md-4"><label><h3>商品拍卖开始时间：</h3></label></div>
                        <span class="col-md-8"><h3><fmt:formatDate value="${goods.gstarttime}" type="both"/></h3></span>
                    </div>
                    <div class="row clearfix">
                        <div class="col-md-4"><label><h3>商品拍卖截至时间：</h3></label></div>
                        <span class="col-md-8"><h3><fmt:formatDate value="${goods.gendtime}" type="both"/></h3></span>
                    </div>
                    <c:if test="${goods.gstate == 1}">
                        <div class="row clearfix">
                            <div class="col-md-4"><label><h3>请输入拍卖金额：</h3></label></div>
                            <div class="col-md-8" style="padding-top:16px;">
                                <form class="form-inline" action="${pageContext.request.contextPath}/putMoney" method="get">
                                    <div class="form-group col-md-6" >
                                        <label class="sr-only" for="exampleInputAmount">Amount (in RMB)</label>
                                        <div class="input-group">
                                            <div class="input-group-addon">￥</div>
                                            <input type="text" class="form-control" id="exampleInputAmount"
                                                   placeholder="Amount" name="newprice" required pattern="^[1-9]\d*$" title="金额格式：正整数">
                                            <input name="gid" value="${goods.gid}" hidden="hidden"/>
                                            <div class="input-group-addon">.00</div>
                                        </div>
                                    </div>
                                    <button type="submit" class="btn btn-primary">加价</button>
                                </form>
                            </div>
                        </div>
                    </c:if>
                    <c:if test="${goods.gstate == 2}">
                        <h3>亲~拍卖结束~赶下场吧~( ▼-▼ )</h3>
                    </c:if>
                    <c:if test="${goods.gstate == 0}">
                        <h3>该商品还未审核~</h3>
                    </c:if>
                </div>
            </div>
        </div>

        <div class="col-md-12">
            <h1>
                商品描述
            </h1>
            <h4>
                ${goods.gdetail}
            </h4>
        </div>
    </div>

</div>
</body>
</html>

